#include<bits/stdc++.h>
#define N 1100000
#define db double
#define ll long long
#define ldb long double
#define ull unsigned long long
using namespace std;
const int h=3,ki=149,mo=998244353;
int mod(int x){return (x%mo+mo)%mo;}
int inc(int x,int k){x+=k;return x<mo?x:x-mo;}
int dec(int x,int k){x-=k;return x>=0?x:x+mo;}
int ksm(int x,int k)
{
	int ans=1;
	while(k){if(k&1)ans=1ll*ans*x%mo;k>>=1;x=1ll*x*x%mo;}
	return mod(ans);
}
int inv(int x){return ksm(x,mo-2);}
int read()
{
	char ch=0;int x=0,flag=1;
	while(!isdigit(ch)){ch=getchar();if(ch=='-')flag=-1;}
	while(isdigit(ch)){x=(x<<3)+(x<<1)+ch-'0',ch=getchar();}
	return x*flag;
}
void write(int x)
{
	if(!x)return (void)putchar(48);
	if(x<0)putchar(45),x=-x;
	int len=0,p[20];
	while(x)p[++len]=x%10,x/=10;
	for(int i=len;i>=1;i--)putchar(p[i]+48);
}
struct edge{int to,nxt;}e[N];
int num,head[N];
void add(int x,int y){e[++num]={y,head[x]};head[x]=num;}
bool cut[N];
int times,dfn[N],low[N];
void tarjan(int x,int rt)
{
	int cnt=0;
	dfn[x]=low[x]=++times;
	for(int i=head[x];i!=-1;i=e[i].nxt)
	{
		int to=e[i].to;
		if(!dfn[to])
		{
			cnt++;tarjan(to,rt);
			low[x]=min(low[x],low[to]);
			if(x!=rt&&dfn[x]<=low[to])cut[x]=true;
		}
		else low[x]=min(low[x],dfn[to]);
	}
	if(x==rt&&cnt>=2)cut[x]=true;
}
int main()
{
	int n=read(),m=read();
	num=-1;memset(head,-1,sizeof(head));
	for(int i=1;i<=m;i++){int x=read(),y=read();add(x,y);add(y,x);}
	for(int i=1;i<=n;i++)if(!dfn[i])tarjan(i,i);
	int ans=0;
	for(int i=1;i<=n;i++)if(cut[i])ans++;write(ans);putchar('\n');
	for(int i=1;i<=n;i++)if(cut[i])write(i),putchar(' ');
	return 0;
}
